package com.wtf.dsp.admin.core.parser;

import cn.hutool.core.collection.CollUtil;
import org.apache.ibatis.binding.MapperMethod;

import java.util.Iterator;
import java.util.Map;

/**
 * ClassName: ParamNameResolver
 * Description:
 * date: 2023/7/14 15:08
 *
 * @author linhuanyou
 * @version 1.0
 */
public class ParamNameResolver {

    public static Object getNamedParams(Map<String,Object> params){
        Map<String, Object> parameterObject = new MapperMethod.ParamMap();
        if(CollUtil.isEmpty(params)){
            return parameterObject;
        }
        int i = 0;
        for(Iterator var5 = params.entrySet().iterator(); var5.hasNext(); ++i) {
            Map.Entry<String, Object> entry = (Map.Entry)var5.next();
            parameterObject.put(entry.getKey(), entry.getValue());
            String genericParamName = "param" + String.valueOf(i + 1);
            parameterObject.put(genericParamName, entry.getValue());
        }
        return parameterObject;
    }

}
